In USB 2.0 and 1.1 driver protocols, there are strict regulations for the operation frequencies of low-speed, full-speed, and high-speed communication interfaces between USB hosts and USB devices for satisfying various applications. For example, the data rate specification of data streams in low-speed USB hosts is 1.5 MHz±1.5%, for keyboards, mice and so on, in full-speed USB hosts is 12 MHz±0.25%, for audio applications and microphones, and in high-speed hosts is 480 MHz±0.05%, for video applications and imaging. Conventionally, as a frequency source of a USB device, a crystal oscillator or a resonant oscillator, optionally with a digital phase lock loop (PLL), is used to generate an accurate frequency signal. However, this approach is impossible to allow the frequency source integrated into the integrated circuit (IC) of the USB device.
For the purposes of reducing costs and enhancing consistence among elements, the IC of a USB device is integrated with resistors and capacitors that establish an internal RC oscillator as the frequency source of the USB device. However, due to process variation, the RC oscillator generates frequency with a potential error up to ±25%, failing to meet the regulations of the USB driver protocols.
Strict regulations are provided in the USB interface communication protocols for the formats of output packets in the data streams of a USB host. As shown in FIGS. 1 and 2, when a USB interface communicates in full-speed, the data stream 10 output from a USB host consists of a plurality of data frames 12, each of which has a temporal length of 1 ms and includes a plurality of packets, for example, a token packet 14, a data packet 16 and a handshake packet 18. Further, each data frame 12 includes a start of frame (SOF) token packet 11 as a starting point of itself and hence, the time interval between two adjacent SOF token packets 11 is 1 ms. Moreover, a token packet 14 has a fixed bits period of 32 bits, a data packet 16 has a bits period of less than 8,216 bits, and a handshake packet 18 has a fixed bits period of 16 bits. Each of the token packet 14, data packet 16, and handshake packet 18 has a synchronization sequence (SYNC) field with a fixed bits period of 8 bits and a fixed bit value, and a packet identifier (PID) field with a fixed bits period and a variable bit value. Thus, the properties of the data frame 12, token packet 14, data packet 16, and handshake packet 18 in a data stream output from a USB host can be used to acquire a signal length of the data stream of the USB host as a trimming base for the frequency of an RC oscillator inside a USB device to trim the internal RC oscillator of the USB device, so as to meet the frequency accuracy of the USB driver protocols and synchronize the USB device and the data stream signals of the USB host.
In U.S. Pat. No. 7,453,958, the frequency of an internal oscillator of a USB device is coarsely tuned by virtue of the property that a synchronization sequence field has a fixed bits period and then fine-tuned by virtue of the property that the time interval between two adjacent SOF token packets 11 is 1 ms. Thus, via digital-to-analog conversion (DAC) in the coarse-tuning and fine-tuning steps, the frequency of an internal oscillator of a USB device is trimmed and becomes accurate with respect to the data stream of a USB host. However, as this two-step trimming process (i.e., coarse-tuning followed by fine-tuning) relies on the first data frame in the data stream of the USB host for coarse-tuning and the second and third data frames in the data stream of the USB host for fine-tuning, not only is the trimming time relatively long (about the time period of three data frames), but also is required a relatively complicated circuit.